home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / bbs / e_page1_0.lha / E!Page1.0.rexx < prev    next >
OS/2 REXX Batch file  |  1994-08-13  |  3KB  |  148 lines

  1. /* Chat-Door for Excelsior! */
  2.  
  3. OPTIONS RESULTS
  4.  
  5. /* Change pstep for longer or shorter paging-time */
  6.  
  7. pstep = 30
  8. ptime = pstep*60
  9.  
  10. call addlib("apig.library",0,-30,0)
  11. call addlib("rexxsupport.library",0,-30,0)
  12.  
  13. call init
  14.  
  15. pname = "chatport"
  16.  
  17. p = openport(pname)
  18.  
  19. call set_apig_globals()
  20.  
  21. /* E!-part starts here... */
  22.  
  23. print ' '
  24. do t = 1 to 6
  25.     print text.t
  26. end
  27.  
  28. sendstring "A\c3|\c7"
  29. receive
  30. reason = result
  31.  
  32. len = length(reason)
  33.  
  34. if reason = '' then do 
  35.     print '0d0a0d0a'x||'\c2NO Reason NO Chat !'
  36.     exit
  37.     end
  38.  
  39. /* Intuition Part starts here */
  40.  
  41. TITLE = "E!-Page1.0 by ACP-Development in 08/94"
  42. IDCMP = VANILLAKEY
  43. FLAGS = GIMMEZEROZERO+WINDOWDEPTH+WINDOWDRAG
  44.  
  45. scr = 0
  46.  
  47. buf = allocmem(200,MEMF_CLEAR)
  48. call getscreendata(buf,200,1,0)
  49.  
  50. xr = getvalue(buf,68,2,'n')
  51. yr = getvalue(buf,70,2,'n')
  52.  
  53. ws = len*9+108
  54.  
  55. if ws<320 then ws = 320
  56.  
  57. xp = xr%2-ws%2
  58. yp = yr%2-50
  59.  
  60. win = openwindow(pname,xp,yp,ws,100,0,0,IDCMP,FLAGS,TITLE,scr,1,0,0)
  61.  
  62. fp = maketattr(win,'pearl.font',8)
  63. call openfont(fp)
  64.  
  65. rp = getwindowrastport(win)
  66.  
  67. call activatewindow(win)
  68.  
  69. x= screentofront(0)
  70.  
  71. getuser 1
  72. name = result
  73.  
  74. outs.1 = name||' is paging you!'
  75. outs.2 = 'Chat-Reason: '||reason
  76. outs.3 = '... Press any key to answer Chat-Request ...'
  77.  
  78. sp = ws%2-9*(length(outs.3)%2)
  79.  
  80. xk.1 = 0 ; yk.1 = 20
  81. xk.2 = 18 ; yk.2 = 20+16
  82. xk.3 = 18+sp ; yk.3 = 20+16*2
  83.  
  84. ln = length(outs.1)
  85. xk.1 = xk.1 + ws%2-9*ln%2
  86. ln = length(outs.2)
  87. xk.2 = xk.2 + ws%2-9*ln%2
  88.  
  89. do t = 1 to sp
  90.     outs.5 = ' '||outs.5
  91.     end
  92.  
  93. do t = 1 to 3
  94.         pitext(rp,xk.t,yk.t,outs.t,1,0,1,fp)
  95. end
  96.  
  97. print "B"
  98.  
  99. print ' '
  100. print '\c3Press any key to quit paging'||'0d0a'x
  101. sendstring '\c2Paging '
  102.  
  103. logentry 'Chat request by '||name||' .... Reason: '||reason
  104.  
  105. changewhere reason
  106. changewhat 'Chat-Request'
  107.  
  108. ex = 0
  109. vk = 0
  110.  
  111. do t = 0 to ptime
  112.     if t//pstep = 0 then sendstring '.'
  113.     checkio
  114.     if result = true then ex = 1
  115.     msg = getpkt(pname)
  116.     if ex = 1 then leave
  117.     if msg = '00000000'x then iterate
  118.     class = getarg(msg,0)
  119.     if class = VANILLAKEY then vk = 1
  120.     x = reply(msg,0)
  121.     if vk = 1|ex = 1 then leave
  122. end
  123.  
  124. print '0d0a0d0a'x
  125.  
  126.  
  127. if vk = 1 then do 
  128.     print 'The SYSOP is going to enter the Chat-Mode soon!'
  129.     openscreen
  130.     end
  131. else if ex = 0 then print 'The SYSOP seems not to be available...'
  132.     else print 'Aborted ... User break'
  133.  
  134. x = closewindow(win)
  135.  
  136. bufferflush
  137.  
  138. call freemem(buf,200)
  139.  
  140.  
  141. init:
  142. text.1 = '\c3+-----------------------< \c1Enter a reason for Chat \c3>----------------------+'
  143. text.2 = '\c3+------------------------------------------------------------------------+'
  144. text.3 = '\c3|                                                                        |'
  145. text.4 = '\c3+------------------------------------------------------------------------+'
  146. text.5 = '\c6  --------- \c8\c4 E!-Page1.0 - Coded by the \c6ACP-Development\c8 \c4in 8/94 \c6 -------- '
  147. text.6 = '\c3   Amiga Crackpoint --- \c2*\c3 --- +43 2252 46519\c3 --- \c2*\c3 --- 2 Lines USR V.FC'
  148.